import { getMessageNumber } from "@/api/message/message";

const messageStore = defineStore("message", {
  state: () => ({
    messagenum: 0,
  }),
  actions: {
    // 退出系统
    getmessagenum() {
      return new Promise((resolve, reject) => {
        getMessageNumber()
          .then((res) => {
            this.messagenum = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
  },
});

export default messageStore;
